package yf.mall.service;

import yf.mall.entity.LevelEntity;
import com.yf.service.BaseService;

import java.math.BigDecimal;
import java.util.List;

/**
 * 级别Service接口
 *
 *
 *
 * @date Thu Jul 11 12:00:51 CST 2019
 */
public interface LevelService extends BaseService<LevelEntity> {
//     UserVo getVo(Long id);

    //找出比某人级别低的级别
    List<LevelEntity> findLowLevel(Long userId);

    //修改级别
//    LevelEntity changeLevel(Long userId,Long toUserId,Long levelId);

    //自动升级
//    void autoLevel(Long userId,Long leveId,String orderNo,String remark);

    /**
     * @param userId
     * @param oldLevelId
     * @param toLevelId
     * @param remark
     * @return
     */
    void changeLevel(Long userId,Long oldLevelId,Long toLevelId,String orderNo,String remark);


    List<LevelEntity> findlist();

    /**
     * 根据经验值查找级别
     * @param exp
     * @return
     */
//    LevelEntity findByExp(BigDecimal exp);

    /**
     * 根据经验值修改级别
     * @param userId
     * @param exp 当前经验值
     * @return
     */
//    LevelEntity changeLevelByExp(Long userId,BigDecimal exp);

    LevelEntity findByUserId(Long userId);
}
